Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-lab-function

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-lab-function

Use lab() and lch() color functions in CSS

  • 6.0.19
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5M
decreased by-53.2%
Maintainers
3
Weekly downloads
 
Created

What is postcss-lab-function?

The postcss-lab-function package is a PostCSS plugin that allows you to use the CSS Lab color function in your stylesheets. This function enables you to define colors in the CIE LAB color space, which is a more perceptually uniform color space compared to RGB or HSL. This can be particularly useful for creating color schemes that are more consistent and visually appealing.

What are postcss-lab-function's main functionalities?

Convert LAB colors to RGB

This feature allows you to write colors in the LAB color space in your CSS, and the postcss-lab-function plugin will convert them to RGB for you. This makes it easier to work with LAB colors without worrying about browser compatibility.

/* Input CSS */
body {
  color: lab(54.29% 80.82 69.88);
}

/* Output CSS */
body {
  color: rgb(255, 0, 0);
}

Support for alpha transparency

This feature allows you to include an alpha transparency value in your LAB color definitions. The plugin will convert these to the appropriate RGBA values in the output CSS.

/* Input CSS */
body {
  color: lab(54.29% 80.82 69.88 / 0.5);
}

/* Output CSS */
body {
  color: rgba(255, 0, 0, 0.5);
}

Custom properties support

This feature allows you to use CSS custom properties (variables) with LAB colors. The plugin will convert the LAB colors to RGB and preserve the custom properties in the output CSS.

/* Input CSS */
:root {
  --main-color: lab(54.29% 80.82 69.88);
}
body {
  color: var(--main-color);
}

/* Output CSS */
:root {
  --main-color: rgb(255, 0, 0);
}
body {
  color: var(--main-color);
}

Other packages similar to postcss-lab-function

Keywords

FAQs

Package last updated on 07 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc